//
//  SWStageSummaryReq.swift
//  ChildStory
//
//  Created by linhan on 2016/12/23.
//  Copyright © 2016年 Aiya. All rights reserved.
//

import Foundation

class SWStageSummaryReq: SWBaseRequest
{
    var stageID:String = ""
    
    override init()
    {
        super.init()
        api = SWRequestAPI.StageSummaryFetch
    }
    
    override var params:Any?
    {
        return ["timeId":stageID]
    }
    
    override func JSONToModel(_ json:JSON, JSONString:String, JSONData:Data) -> AnyObject?
    {
        return Mapper<SWStageSummaryRsp>().map(JSONString: JSONString)
    }
}

class SWStageSummaryRsp: NSObject,Mappable
{
    var title:String?
    var events:[SWEventSummaryRsp]?
    required init?(map: Map) { }
    
    func mapping(map: Map) {
        title        <- map["BaseModle.title"]
        events  <- map["BaseModle.list"]
    }
}

class SWEventSummaryRsp: NSObject,Mappable
{
    var type:String?
    var count:Int?
    var content:String?
    var features:[SWEventFeatureSummaryRsp]?
    required init?(map: Map) { }
    
    func mapping(map: Map) {
        type        <- map["casetypeid"]
        count  <- map["groupcount"]
        content  <- map["content"]
        features  <- map["features"]
    }
}



class SWEventFeatureSummaryRsp: NSObject,Mappable
{
    var title:String?
    var id:Int?
    var content:String?
    
    required init?(map: Map) { }
    
    // Mappable
    func mapping(map: Map) {
        id        <- map["tagid"]
        title        <- map["value"]
        content      <- map["content"]
    }
}
